<%@page import="com.wowangz.cms.systemmanage.passwordpolicy.api.PasswordPolicyController"%>
<%@page import="com.wowangz.cms.systemmanage.passwordpolicy.pojo.PasswordPolicy"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="com.wowangz.cms.common.utils.SysConstant"%>

<%-- 引入页面头 --%>
<%@ include file="/pageHead.jsp" %>
<form name="form1" id="form1" method="post">	
	<div class="pageMain">
		<div class="pageTitle">
			<%=MessageResourcesUtils.getMessage(request, "systemmanage.bascsetting.title") %>
			<span></span>
			<%=MessageResourcesUtils.getMessage(request, "systemmanage.passwordpolicy.title") %>
			<span></span>
			<%=MessageResourcesUtils.getMessage(request, "systemmanage.passwordpolicy.list") %>
		</div>
		<div class="pageBody">
			<input value="${passwordIds}" type="hidden" name="passwordIds" id="passwordIds">
			<div class="panel-title">
				<h2><%=MessageResourcesUtils.getMessage(request, "systemmanage.passwordpolicy.title") %></h2>
			</div>
		  	<table class="tableFrom">
			  	<tbody>
			        <tr style="font-weight: bold;font-size:16px;">
			        	<td class="td02"></td>
			        	<td class="td02">
			        		<%=MessageResourcesUtils.getMessage(request, "systemmanage.passwordpolicy.passwordcode") %>
			        	</td>
			        	<td class="td02">
			        		<%=MessageResourcesUtils.getMessage(request, "systemmanage.passwordpolicy.value") %>
			        	</td>
			        	<td class="td02">
			        		<%=MessageResourcesUtils.getMessage(request, "systemmanage.passwordpolicy.description") %>
			        	</td>
			        </tr>
			        <c:forEach items="${list}" var="list" varStatus="pass">
			        	<tr>
				        	<td class="td02">${pass.count }</td>
				        	<td class="td02">${list.code}</td>
				        	<td class="td02">
								<input name="${list.id}_value" id="${list.id}_value" value="${list.value}">
							</td>
				        	<td class="td02">${list.description}</td>
				        </tr>
			        </c:forEach>
					<tr>
						<td colspan="6" align="right">
							
						</td>
					</tr>
			   	</tbody>
			</table>
		</div>
		<div class="button-group">
			<button type="button" class="btn btn-default " id="butSave" name="butSave" >
				<%=MessageResourcesUtils.getMessage(request, "common.button.save") %>
			</button>
			<%-- <button type="button" class="btn btn-default" id="butReturn" name="butReturn" >
				<%=MessageResourcesUtils.getMessage(request, "common.button.back") %>
			</button> --%>
		</div>
	</div>
</form>

<script type="text/javascript">
	$(document).ready(function() {
		//加载数据库的配置信息
		$("#butSave").click(function(){
			showSending();
			$.ajax({
				type: 'POST',
				url: '${systemctx}/systemmanage/passwordpolicy/savePasswordPolicy.json',
				dataType: 'json',
				data:$("#form1").serialize(),
				success: function (data) {
					//关闭执行...
					closeSending();
					if(data.code == '<%=PasswordPolicyController.Response.SUCCESS%>'){
						alert(data.message);
						window.location.href="${systemctx}/systemmanage/passwordpolicy/toPasswordpolicy.web";
					} else {
						alert(data.message);
						return;
					}
				}
			});
		});
		
		$("#butReturn").click(function() {
			window.history.go(-1);
		});
	});

</script>

<%-- 引入页面尾 --%>
<%@ include file="/pageFloor.jsp" %>
